/*
 * @Author: w_yy
 * @Date: 2023-03-21 10:28:24
 * @LastEditors: w_yy
 * @LastEditTime: 2023-03-21 10:32:40
 * @FilePath: \vue-project\src\directives\premission.js
 * @Copyright: 2023 沈阳东软智睿放疗技术有限公司
 * @Descripttion: 该文件用于OIS系统。版权由东软智睿放疗技术有限公司所有
 */
export function setupPermissionDirective(app) {
  let usersPermissions = ["user"];
  app.directive("hasPermission", {
    mounted(el, binding, vnode) {
      const { value } = binding;
      let f = usersPermissions.some((p) => {
        return p.indexOf(value) !== -1;
      });
      if (!f) {
        el.parentNode && el.parentNode.removeChild(el);
      }
    },
  });
}
